1. Field of the Invention
The present invention relates to a numerical contorl unit and, particularly, to the input processing of a machining program for the numerical control unit.
2. Background of the Invention
A numerical control unit performs numerical control processing in accordance with a machining program provided from a paper tape, etc. Specifically, the numerical control unit drives a machine tool for machining a workpiece according to the results of processing.
FIG. 13 is a block diagram of a numerical control unit known in the art. A machining program read from a tape reader 11 on a block-by-block basis is first entered into a control unit 12 which contains a processor, a control program memory, etc. The control unit 12 then performs numerical control processing in accordance with the machining program and drives servo motors of a machine tool 14 for moving a table or a tool as preprogrammed, or for controlling other functions of the machine tool 14, e.g., coolant ON/OFF, spindle forward/reverse/stop, etc., via an electrical control box 13. The known numerical control unit includes a control panel 15 having zeroing, jogging and other command switches, buttons, etc., a manual data input device 16 (hereinafter referred to as an "MDI") for manually entering block-by-block command data, etc., and a display unit 17 for displaying the current position, etc., of the machine.
A computerized numerical control unit system (hereinafter referred to as a "CNC") includes tape reader or other program input device 11, control unit 12, control box 13, control panel 15, manual input device 16 and display 17. As described above, the control unit 12 of the CNC is a computer-controller apparatus having a processor (CPU), a control program memory, etc., and the processor controls the machine tool through predetermined numerical control processing in accordance with a control program and the machining program.
In general, even if exactly the same machining is to be carried out, slight modifications must be made to the CNC machining program because of different machine tools and CNC models. Specifically, different command values may be provided depending on the specific machine tool and CNC type employed. For instance, one CNC machine tool interprets command M201 as a coolant ON command while a different CNC machine tool would employ command M305. Consequently, in such a case, a new CNC machining program must be written for each CNC machine tool employed, although most contents of that program are the same.
To overcome this disadvantage, it has been proposed to register in a memory 20, as shown in FIG. 14, conversion tables (GTB), (MTB) and (PTB) for converting the numerical value data of specific word data (G codes, M codes and coordinate value command codes) in the machining program (e.g., changing an M command value "201" into "305") and converting the word data of coordinate value command codes (e.g., changing word data "X" into "Y" and vice versa). This conversion table scheme is described in Japanese Patent Disclosure Publication No. 267804-1987.
However, since the conversion tables illustrated in FIG. 14 convert only the numerical value data of the G and M command codes and the word data of the coordinate value command codes, a new machining program must still be written if even a small portion of the original machining program is to be changed, e.g., if the machining program is to be changed to reflect the different machining shown in FIGS. 15(a) and 15(b), for example.
To rectify this disadvantage, it is known in the art to write a machining program by means of an optional block skip function as described in Japanese Patent Publication No. 46846-1986. This reference describes a numerical control unit equipped with an optional block skip function.
FIG. 16 is a block diagram showing the major components of the prior art device which includes a tape reader 11, memory 20, a select switch 21, a block select switch set 22, a block skip circuit 23, a buffer storage circuit 24, a data processor 25, and a machining program tape.
FIGS. 15(a) and 15(b) are machining diagrams used to describe the operation of the known unit shown in FIG. 16, wherein the numeral 40 is a workpiece to be machined and numerals 41, 42 and 43 are positions of holes to be drilled.
When the holes are to be drilled in the positions 41, 42 and 43 specified by an operator as shown in FIG. 15(a), it is first necessary to include the following three blocks in the drilling process section of the machining program:
/ 1N101G81X31 . . . ; PA0 / 2N102G81X32 . . . ; PA0 / 3N103G81X33 . . . ;
The slash, ("/") preceding each block is skipped object information indicating that the block is under optional block skip control, and the subsequent character 1, 2 or 3 is skip select information which determines whether or not the block is to be skipped. N101 to N103 are beginnings of data words commanding that the holes be drilled in the positions 41 to 43, respectively, and ";" is a character indicating a block end. The program including the above three blocks is stored in a numerical value control information recording medium, such as paper tape, in the form of a machining program or stored directly in the internal memory 20 of the numerical control unit as numerical value information.
On the control panel, there is provided the block select switch set 22 for entering information representing which of the blocks under optional block skip control and stored in the numerical value information recording medium is/are to be valid and is/are to be invalid in actual machining. Specifically, as shown in FIG. 17, the block select switch set 22 comprises, for example, three switches 31, 32, 33 arranged in correspondence with skip select information 1, 2 and 3. An "off" switch provides information to the block skip circuit 23 indicating that the corresponding block is valid, whereas an "on" switch provides information to the block skip circuit 23 indicating that the corresponding block is invalid.
Hence, the operator moves the block select switches 22 to determine whether or not holes are to be drilled in the positions 41 through 43. Thus, different sets of holes shown in FIGS. 15(a) and 15(b) can be drilled with a single machining program.
In the known method using the optional block skip, however, the optional block skip command must be specified for each block and whether or not a block is to be executed or not is selected by the select switch. As such, the switch setting operation is rather cumbersome and the operator is prone to misoperate the switch. In addition, when the machining program is to be modified little by little for each machine tool model, the machining program must be altered accordingly, resulting in increased expenses and overall costs.
As a programmable process of controlling the machining program, it has been conceived to control a sequence of machining program execution by means of a user macro method as described in Japanese Patent Disclosure Publication No. 168223-1981. According to this method, the sequence of machining program execution can be controlled as necessary by specifying commands which control the sequence of machining program execution, e.g., IF and WHILE statements.
In the method using the user macro discussed above, the processing capability of the user macro must be incorporated into the CNC system, resulting in a modification to the whole CNC system. Further, each time the sequence of machining program execution is to be altered the operator must, for example, define data for the macro variable because that sequence is controlled in accordance with the macro variable. Therefore, the setting operation is troublesome and misoperation is likely.